One or more aspects relate, in general, to processing within a processing environment, and in particular, to execution of instructions that alter a privilege level or other operating state of the processing environment.
Processors execute instructions that direct the processors to perform specific operations. The instructions may be part of user applications that perform user-defined tasks, or part of operating system applications that perform system level services, as examples. The instructions included within user applications have a certain privilege level, while the instructions of the operating system applications have another privilege level. The privilege level of the operating system instructions is typically higher than the privilege level of the user applications. This higher privilege is to provide security within the processors preventing user applications from causing damage within the processors.
Instructions, regardless of the type or privilege level, are executed by the processors. The processors may use different types of processing techniques to process the instructions. One processing technique is referred to as pipelined processing, in which processing is performed in stages. Example stages include a fetch stage in which the processor fetches an instruction from memory; a decode stage in which the fetched instruction is decoded; an execute stage in which the decoded instruction is executed; and a complete stage in which execution of the instruction is completed, including updating architectural state relating to the processing. Other and/or different stages are also possible.
The use of pipelined processing for certain instructions may create latency impacting performance. This is particularly true in those situations in which execution of the instruction requires that all instructions in the pipeline, that are fetched after the instruction, be flushed and the instruction causes one or more other instructions to be fetched from the beginning of the pipeline.